<?php
/**
 * Created by PhpStorm.
 * User: chenxiang
 * Date: 2017/4/26
 * Time: 12:53
 */

namespace App\Http\Controllers\Home;


use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;

class LoginController extends \App\Http\Controllers\Auth\LoginController
{

    protected $redirectTo = '/'; //定义 登陆成功 跳转域
    public function username(){ // 定义 用户名字段
        return 'username';
    }


    // 登陆 首页
    public function index(Request $request){
        $errors =array();
        if($request->session()->has('errors')){
            $errors = ($request->session()->get('errors')->toarray());
        }
        return view('Home.Login.Login',compact('errors'));
    }
//


    /**
     * Get the guard to be used during authentication.
     *
     * @return \Illuminate\Contracts\Auth\StatefulGuard
     */
    protected function guard()
    {
        return Auth::guard('admin');
    }

}